import { Command } from '@/commands/command.ts'
import { new_command } from '@/models/command.ts'

export class CalcCommand extends Command {
    public static new(args: string): Command {
        const command = new_command()
        command.args = args
        command.name = 'calc'
        command.component = 'AllowCopyCommandComponent'

        return new CalcCommand(command, false)
    }

    usage(): string {
        return 'calc [-f|--fix fix] 中缀计算式'
    }

    description(): string {
        return `<div>计算中缀表达式的值<div>
        <br/>
        <div>选项说明:</div>
        <br/>
        <div class="option-row"><span class="option-option">-f --fix</span><span>指定计算结果的后缀长度，默认为2位</span></div>`
    }
}
